﻿@model List<KRM.Core.vWebHREmployee>

@{
    ViewBag.Title = "Employees Management";
    Layout = "/views/shared/_HRLayout.cshtml";
}
<div class="row">
    <div class="col-md-12">
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title">
            Employees <small>Employees Management</small>
        </h3>
                 <ul class="page-breadcrumb breadcrumb" style="margin-bottom: 10px;">
                  <li>
                     <i class="icon-home"></i>
                     <a href="/Home">Home</a> 
                     <span class="icon-angle-right"></span>
                  </li>
                  <li>
                     <a href="/Employees">Management</a>
                     <span class="icon-angle-right"></span>
                  </li>
                  <li><a href="/Employees">Employees</a></li>
               </ul>
        <!-- END PAGE TITLE & BREADCRUMB-->
    </div>
</div>
<div class="row">
    
    <div id="MenuLinkDetail" class="modal fade" tabindex="-1" data-width="600">       
    </div>
    <div class="col-md-12">
        @Html.Partial("Partial/_MessageResult")
    </div>
</div>
<div class="row">
    <div class="col-md-2">
        <div class="form-group">
            <a href="/Employees/AddEmployees" class="btn green">Add New <i class="icon-plus"></i></a>
        </div>
    </div>
</div>
<div class="row">
    <form class="form-horizontal col-md-12" id="frFilterEmployees" action="/Employees" method="GET">
        <div class="row">
            <div class="col-md-3">
                <div class="row" >
                    <label class="control-label col-md-4">Site:</label>
                    <div class="col-md-8">
                        @Html.DropDownList("SiteId",null,new {@class="form-control"})
                    </div>
                </div>
            </div>
            <div class="col-md-3">
                    <div class="row" >
                        <label class="control-label col-md-4">Department:</label>
                        <div class="col-md-8">
                            @Html.DropDownList("DepartmentId",null,new {@class="form-control",onchange="GetPositionByDepartmentFilter(this.value)"})
                        </div>
                    </div>
                </div>
            <div class="col-md-4">
                <div class="row" >
                    <label class="control-label col-md-4">Position:</label>
                    <div class="col-md-8">
                        @Html.DropDownList("PositionId",null,new {@class="form-control",id="lbxPosition"})
                    </div>
                </div>
            </div>
            <div class="col-md-2">
                <div class="row" >
                    <div class="col-md-12">
                        <button type="submit" class="btn green">Search <i class="m-icon-swapright m-icon-white"></i></button>
                    </div>
                </div>
            </div>
        </div>
    </form>

</div>

<div class="row">
    <div class="col-md-12"> <table class="table table-striped table-bordered table-hover dataTable" >
                          <thead>
                              <tr>
                                  <th>Full Name</th>
                                  <th>User Login</th>
                                  <th>Position</th>
                                  <th>Department</th>
                                  <th>Site</th>
                                  <th>Date Created</th>
                                  <th>Edit</th>
                                  <th>Active</th>
                              </tr>
                          </thead>
                          <tbody>
                              @foreach (var item   in Model)
                              {     
                                  <tr>
                                      <td style="text-align: center">
                                           <a href="/Employees/EditEmployees/@item.PersonalId"> @item.FullName</a>
                                      </td>
                                      <td style="text-align: center">@item.UserLogin</td>
                                       <td style="text-align: center">@item.PositionName</td>
                                          <td style="text-align: center">@item.DepartmentName</td>
                                          <td style="text-align: center">@item.SiteName</td>
                                      <td style="text-align: center">@item.DateCreated</td>
                                      <td style="text-align: center">
                                          <a type="button" onclick="" href="/Employees/EditEmployees/@item.PersonalId" class="btn btn-sm blue">View <i class="icon-edit"></i></a>
                                      </td>
                                      @*<td style="text-align: center">
                                          <a href="/Employees/DeleteEmployees/@item.Id" onclick="javascript:return confirm('Are you sure?');" class="btn btn-sm red">Delete <i class="icon-remove"></i></a>
                                      </td>*@
                                      <td style="text-align: center">
                                          @if (@item.Active==false)
                                          {
                                              <a href="/Employees/ActiveEmployees/@item.PersonalId?active=true" class="btn btn-sm green">Active <i class="icon-check"></i></a>
                                          }
                                          else
                                          { <a href="/Employees/ActiveEmployees/@item.PersonalId?active=false" class="btn btn-default btn-default-sm">Disable <i class="icon-remove"></i></a>
                                          }
                                      </td>
                                  </tr>
                              }
                          </tbody>
                      </table>
    </div>
</div>